< previous page page_90 next page >

Page 90
   If hRasConn = 0 Then
      MsgBox "No RAS connection open"
      Exit Sub
   End If
   Call RasHangUp(hRasConn)
End Sub
The dialext structure is a RASDIALEXTENSIONS structure. Only the dwSize field is set in order for the API function to recognize it as a valid structure. All of the structure fields are left at 0 to use the default values.
The function then clears the status list box and uses the RasGetEntryDialParams function to load the information for the specified phone book. The RasDial function sets the dwNotifierType parameter to 0 to tell the function that the lpvNotifier parameter is a function address based on a prototype called RasDialFunc. The AddressOf operator can be used to retrieve the memory address of a function in a standard module. A RasDialFunc function is described as follows in the Win32 documentation:
VOID WINAPI RasDialFunc(
    UINT unMsg, // type of event that has occurred
    RASCONNSTATE rasconnstate, // connection state about to be entered
    DWORD dwError // error that may have occurred
   );
The unMsg parameter of this function is the message WM_RASDIALEVENT, which is defined as follows:
#define WM_RASDIALEVENT 0xCCCD
But you won't need to worry about this, because the value is passed from Windows to your function. The more important value is the rasconnstate parameter, which contains a value describing the current RAS event. The RASCONNSTATE type is an enumerationa 32-bit value. The enumeration is defined as follows:
#define RASCS_PAUSED 0x1000
#define RASCS_DONE   0x2000

#define RASCONNSTATE enum tagRASCONNSTATE
RASCONNSTATE
{
    RASCS_OpenPort = 0,
    RASCS_PortOpened,

 
< previous page page_90 next page >